package com.pbs.contact;

import java.util.ArrayList;

public class Contact {
	private boolean checked = false;
	private String id;
	private String displayName;
	private ArrayList<Phone> phone;
	private ArrayList<Email> email;
	private ArrayList<String> notes;
	private ArrayList<Address> addresses;
	private ArrayList<IM> imAddresses;
	private ArrayList<Organization> organization;

	public Contact() {
	}

	public String getLastName(String name) {
		if (name == null) {
			return "";
		}
		name = name.trim();
		for (int i = name.length() - 1; i >= 0; i--) {
			if (name.charAt(i) == ' ') {
				return name.substring(i).trim();
			}
		}
		return name;
	}

	public String getFirstName(String name) {
		if (name == null) {
			return "";
		}
		name = name.trim();
		for (int i = name.length() - 1; i >= 0; i--) {
			if (name.charAt(i) == ' ') {
				return name.substring(0, i);
			}
		}
		return "";
	}

	public ArrayList<Organization> getOrganization() {
		return organization;
	}

	public void setOrganization(ArrayList<Organization> organization) {
		this.organization = organization;
	}

	public ArrayList<IM> getImAddresses() {
		return imAddresses;
	}

	public void setImAddresses(ArrayList<IM> imAddresses) {
		this.imAddresses = imAddresses;
	}

	public void addImAddresses(IM imAddr) {
		this.imAddresses.add(imAddr);
	}

	public ArrayList<String> getNotes() {
		return notes;
	}

	public void setNotes(ArrayList<String> notes) {
		this.notes = notes;
	}

	public void addNote(String note) {
		this.notes.add(note);
	}

	public ArrayList<Address> getAddresses() {
		return addresses;
	}

	public void setAddresses(ArrayList<Address> addresses) {
		this.addresses = addresses;
	}

	public void addAddress(Address address) {
		this.addresses.add(address);
	}

	public ArrayList<Email> getEmail() {
		return email;
	}

	public void setEmail(ArrayList<Email> email) {
		this.email = email;
	}

	public void addEmail(Email e) {
		this.email.add(e);
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getDisplayName() {
		return displayName;
	}

	public void setDisplayName(String dName) {
		this.displayName = dName;
	}

	public ArrayList<Phone> getPhone() {
		return phone;
	}

	public void setPhone(ArrayList<Phone> phone) {
		this.phone = phone;
	}

	public void addPhone(Phone phone) {
		this.phone.add(phone);
	}

	public boolean isChecked() {
		return checked;
	}

	public void setChecked(boolean value) {
		checked = value;
	}

	/*
	 * public void setHomePhoneNumber(String homeNumber) { this.homeNumber =
	 * homeNumber; }
	 * 
	 * public void setWorkPhoneNumber(String officeNumber) { this.faxNumber =
	 * officeNumber; }
	 * 
	 * public String getWorkPhoneNumber() { return faxNumber; } public String
	 * getHomePhoneNumber() { return homeNumber; } public String
	 * getMobilePhoneNumber() { return mobileNumber; }
	 * 
	 * public void setMobilePhoneNumber(String phone) { this.mobileNumber =
	 * phone; }
	 */

}
